package com.mesd.killer.importer;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ScheduleObject implements Comparable
{
	SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");	
	private String round;

	private String playingTime;

	private String simplifiedHomeTeamName;

	private String traditionalHomeTeamName;

	private String simplifiedAwayTeamName;

	private String traditionalAwayTeamName;

	private String state;

	private String homeTeamScore;

	private String awayTeamScore;

	private String homeTeamHalfScore;

	private String awayTeamHalfScore;

	public ScheduleObject(String round, String playingTime, String simplifiedHomeTeamName,
		String traditionalHomeTeamName, String simplifiedAwayTeamName,
		String traditionalAwayTeamName, String state, String homeTeamScore, String awayTeamScore,
		String homeTeamHalfScore, String awayTeamHalfScore)
	{
		this.round = round;
		this.playingTime = playingTime;
		this.simplifiedHomeTeamName = simplifiedHomeTeamName;
		this.traditionalHomeTeamName = traditionalHomeTeamName;
		this.simplifiedAwayTeamName = simplifiedAwayTeamName;
		this.traditionalAwayTeamName = traditionalAwayTeamName;
		this.state = state;
		this.homeTeamScore = homeTeamScore;
		this.awayTeamScore = awayTeamScore;
		this.homeTeamHalfScore = homeTeamHalfScore;
		this.awayTeamHalfScore = awayTeamHalfScore;
	}

	public String getRound()
	{
		return round;
	}

	public void setRound(String round)
	{
		this.round = round;
	}

	public String getPlayingTime()
	{
		return playingTime;
	}

	public void setPlayingTime(String playingTime)
	{
		this.playingTime = playingTime;
	}

	public String getSimplifiedHomeTeamName()
	{
		return simplifiedHomeTeamName;
	}

	public void setSimplifiedHomeTeamName(String simplifiedHomeTeamName)
	{
		this.simplifiedHomeTeamName = simplifiedHomeTeamName;
	}

	public String getTraditionalHomeTeamName()
	{
		return traditionalHomeTeamName;
	}

	public void setTraditionalHomeTeamName(String traditionalHomeTeamName)
	{
		this.traditionalHomeTeamName = traditionalHomeTeamName;
	}

	public String getSimplifiedAwayTeamName()
	{
		return simplifiedAwayTeamName;
	}

	public void setSimplifiedAwayTeamName(String simplifiedAwayTeamName)
	{
		this.simplifiedAwayTeamName = simplifiedAwayTeamName;
	}

	public String getTraditionalAwayTeamName()
	{
		return traditionalAwayTeamName;
	}

	public void setTraditionalAwayTeamName(String traditionalAwayTeamName)
	{
		this.traditionalAwayTeamName = traditionalAwayTeamName;
	}

	public String getState()
	{
		return state;
	}

	public void setState(String state)
	{
		this.state = state;
	}

	public String getHomeTeamScore()
	{
		return homeTeamScore;
	}

	public void setHomeTeamScore(String homeTeamScore)
	{
		this.homeTeamScore = homeTeamScore;
	}

	public String getAwayTeamScore()
	{
		return awayTeamScore;
	}

	public void setAwayTeamScore(String awayTeamScore)
	{
		this.awayTeamScore = awayTeamScore;
	}

	public String getHomeTeamHalfScore()
	{
		return homeTeamHalfScore;
	}

	public void setHomeTeamHalfScore(String homeTeamHalfScore)
	{
		this.homeTeamHalfScore = homeTeamHalfScore;
	}

	public String getAwayTeamHalfScore()
	{
		return awayTeamHalfScore;
	}

	public void setAwayTeamHalfScore(String awayTeamHalfScore)
	{
		this.awayTeamHalfScore = awayTeamHalfScore;
	}

	@Override
	public int compareTo(Object o)
	{
		int a=0;
		try
		{
			ScheduleObject oo = ((ScheduleObject)o);
			Date date = sdf.parse(this.getPlayingTime());
			
			Date date2 = sdf.parse(oo.getPlayingTime());
			if(this.getRound().equals(oo.getRound()))
			{
				a = date.compareTo(date2);
				if(a == 0)
				{
					a = oo.getSimplifiedHomeTeamName().compareTo(this.getSimplifiedHomeTeamName());
					a = oo.getTraditionalHomeTeamName().compareTo(this.getTraditionalHomeTeamName());
				}
			}

		}
		catch(Exception e)
		{
			
		}
		return a;

	}
}